<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
Route::get('/', function(){
	return redirect("admin");
});
Route::group(['prefix' => config('admin.prefix', 'admin')], function () {
	
Route::group(['middleware' => config('admin.filter.auth')], function () {
	
    Route::resource('goods', 'GoodsController',[
            'except' => 'show',
            'names' => [
                'index' => 'admin.goods.index',
                'create' => 'admin.goods.create',
                'store' => 'admin.goods.store',
                'show' => 'admin.goods.show',
                'update' => 'admin.goods.update',
                'edit' => 'admin.goods.edit',
                'destroy' => 'admin.goods.destroy',
            ],
        ]);
    Route::get('goods/ajaxgoodslist', 'GoodsController@ajaxgoodslist')->name('ajaxgoodslist');
    Route::post('goods/ajaxgetgood', 'GoodsController@ajaxgetgood')->name('ajaxgetgood');
    Route::resource('shipment', 'ShipmentController',[
            'except' => 'show',
            'names' => [
                'index' => 'admin.shipment.index',
                'create' => 'admin.shipment.create',
                'store' => 'admin.shipment.store',
                'show' => 'admin.shipment.show',
                'update' => 'admin.shipment.update',
                'edit' => 'admin.shipment.edit',
                'destroy' => 'admin.shipment.destroy',
            ],
        ]);
    Route::post('shipment/ajaxupdatepay', 'ShipmentController@ajaxupdatepay')->name('ajaxupdatepay');
    Route::get('report/monthreport', 'ReportController@monthreport')->name('monthreport');
    Route::get('report/yearReport', 'ReportController@yearReport')->name('yearReport');
    
    Route::resource('purchase', 'PurchaseController',[
            'except' => 'show',
            'names' => [
                'index' => 'admin.purchase.index',
                'create' => 'admin.purchase.create',
                'store' => 'admin.purchase.store',
                'show' => 'admin.purchase.show',
                'update' => 'admin.purchase.update',
                'edit' => 'admin.purchase.edit',
                'destroy' => 'admin.purchase.destroy',
            ],
        ]);
    
});
Route::get('nofound',['as' => 'admin.nofound', 'uses' => 'NoFoundController@index']);

});